package com.chrray.position.controller.web;

import com.chrray.position.domain.FdJobPostings;
import com.chrray.position.pojo.dto.BaseIdDto;
import com.chrray.position.pojo.dto.web.FdJobPostingsApplyDto;
import com.chrray.position.pojo.dto.web.FdJobPostingsFavDto;
import com.chrray.position.pojo.vo.web.FdJobPostingsExeVo;
import com.chrray.position.service.web.WFdJobPostingsService;
import com.chrray.position.service.web.WFdUserService;
import com.chrray.position.util.result.PageBean;
import com.chrray.position.util.result.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static com.chrray.position.util.result.ResponseResults.PAGE;
import static com.chrray.position.util.result.ResponseResults.success;

/**
 * 业务系统用户控制器
 *
 * @author lm
 * @since 1.0.1 2024-09-02
 */
@RestController
@RequestMapping("/api/web/myPostingsFav")
@Api(tags = "我的收藏")
@AllArgsConstructor
public class WFdMyJobPostingsFavController {
    @Autowired
    private WFdJobPostingsService wFdJobPostingsService;
    @Autowired
    private WFdUserService wFdUserService;


    @GetMapping("/pageMyPostingsFavList")
    @ApiOperation("列表(参数userId)")
    public ResponseResult<PageBean<FdJobPostings>> pageMyPostingsFavList(FdJobPostingsFavDto entity) {
        return PAGE(wFdJobPostingsService.pageMyPostingsFavList(entity));
    }


    @GetMapping("/selectById")
    @ApiOperation("查询详情")
    @ApiResponses({
            @ApiResponse(code=200, message = "ok", response = FdJobPostings.class)
    })
    public ResponseResult<FdJobPostings> selectById(BaseIdDto dto){
        return  success(wFdJobPostingsService.getById(dto.getId()));
    }




}
